﻿using System.Collections.Generic;
using System.Data.SqlClient;
using MyFloridaHouse.LibDTO;

namespace MyFloridaHouse.DataAccess
{
    public partial class DAL_CensusData
    {

        public void UpdateDistrictGeographyShapesByLayer(List<RegionShapeForReductionDTO> geogList)
        {

            using (SqlConnection db = Connect())
            {

                SqlCommand nonQueryCommand = new SqlCommand("", db);
                foreach (RegionShapeForReductionDTO geog in geogList)
                {
                    nonQueryCommand.CommandText = "UPDATE tl10All10Geo SET mapObjectReduced='" + geog.mapGeog + "' WHERE regionID=" + geog.regionID;
                    nonQueryCommand.ExecuteNonQuery();
                }
            }
        }
    }
}
